package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.admin.company.entity.Department;
import com.fz.us.admin.company.entity.User;

import javax.persistence.*;
import java.util.Date;

/**
 * 业务实体类 - 资产入库登记表
 * ============================================================================
 * 版权所有 2017 。
 *
 * @author XuHeng
 * @version 1.0 2017-02-16 。
 * ============================================================================
 */
@Entity
@Table(name="ec_asset")
public class Asset extends BaseFlowEntity {

    private static final long serialVersionUID = 3148936482305164297L;
    /**
     * 对应的资产采购登记表
     */
    private Purchase purchase;
    /**
     * 资产编号
     */
    private String assetNo;

    /**
     * 资产名称 name
     */

    /**
     * 资产品牌
     */
    private String brand;
    /**
     * 规则型号
     */
    private String model;
    /**
     * 采购日期
     */
    private Date datPurchase;
    /**
     * 采购金额
     */
    private double purchaseMoney;

    /**
     * 提交日期
     */
    private Date dateApply;
    /**
     * 文档状态数值
     */
    private int numStatus;
    /**
     * 文档状态文字
     */
    private String txtStatus;
    /**
     * 使用人名字
     */
    private String userName;
    /**
     * 使用部门
     */
    private Department useDepartment;
    /**
     * 使用人
     */
    private User user;

    /**
     * 表单名称
     */
    private String form;

    @Column(nullable=false, columnDefinition = "varchar(50) default '资产入库登记表'")
    public String getForm() {
        return form;
    }

    public void setForm(String form) {
        this.form = form;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public Purchase getPurchase() {
        return purchase;
    }

    public void setPurchase(Purchase purchase) {
        this.purchase = purchase;
    }

    public String getAssetNo() {
        return assetNo;
    }

    public void setAssetNo(String assetNo) {
        this.assetNo = assetNo;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public Date getDatPurchase() {
        return datPurchase;
    }

    public void setDatPurchase(Date datPurchase) {
        this.datPurchase = datPurchase;
    }

    public double getPurchaseMoney() {
        return purchaseMoney;
    }

    public void setPurchaseMoney(double purchaseMoney) {
        this.purchaseMoney = purchaseMoney;
    }

    public Date getDateApply() {
        return dateApply;
    }

    public void setDateApply(Date dateApply) {
        this.dateApply = dateApply;
    }

    public int getNumStatus() {
        return numStatus;
    }

    public void setNumStatus(int numStatus) {
        this.numStatus = numStatus;
    }

    public String getTxtStatus() {
        return txtStatus;
    }

    public void setTxtStatus(String txtStatus) {
        this.txtStatus = txtStatus;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public Department getUseDepartment() {
        return useDepartment;
    }

    public void setUseDepartment(Department useDepartment) {
        this.useDepartment = useDepartment;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
